﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" ValidateRequest="false" Inherits="Rison.Web.ZP.Test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <script type="text/javascript">
        function addRow(tableId,inputname) {
            var domTable = document.getElementById(tableId);

            var _row = domTable.insertRow();
            var _col = _row.insertCell();
            _col.innerHTML = "&nbsp;";
            _col=_row.insertCell();
            _col.innerHTML="<input type='text' name='" + inputname + "'/>";
            
            _col=_row.insertCell();
            _col.innerHTML = "固定电话 ";
            _col=_row.insertCell();
            _col.innerHTML="<input type='text' name='" + inputname + "' />";
            
            _col=_row.insertCell();
            _col.innerHTML = "手机 ";
            _col=_row.insertCell();
            _col.innerHTML="<input type='text' name='" + inputname + "' />";
            
            _col=_row.insertCell();
            _col.innerHTML = "邮箱 ";
            _col=_row.insertCell();
            _col.innerHTML="<input type='text' name='" + inputname + "' />";


        }
        
        function saveTable(tableId) {
//            var domTable = document.getElementById(tableId);
//            var hid = document.getElementById("Hidden1");
//            hid.value = domTable.innerHTML;
//            alert(hid.value);
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table id="table1"  width="100%" runat="Server">     
    </table>
        
     <table id="table2"  width="100%" runat="Server" >     
    </table>
        <input id="Text1" type="text" style="width:168px" />
    
        <input id="Button1" type="button" value="为table加一行" onclick="addRow('table1','name1');" />
        <input id="Button3" type="button" value="为table加一行" onclick="addRow('table2','name2');" />
        
        <asp:Button OnClientClick="saveTable('table1');" ID="Button2" runat="server" Text="提交到服务器" OnClick="button_click" />
        <input id="Hidden1" type="hidden" runat="Server" />
        <br />
        <asp:Label ID="Label1" runat="server" Text="">aaa</asp:Label><br />
        <asp:Label ID="Label2" runat="server" Text="">bbb</asp:Label>
    </div>
    <asp:SiteMapPath ID="SiteMapPath1" runat="server">
    </asp:SiteMapPath>
    </form>
</body>
</html>
